package com.example.im.entity

import androidx.room.*
import java.io.Serializable

//@Entity(indices = [Index(value = ["id"], unique = true)])
@Entity(
    foreignKeys = [ForeignKey(
        entity = FriendOrRoom::class,
        parentColumns = ["id"],
        childColumns = ["f_id"],
        onDelete = ForeignKey.CASCADE
    )]
)
class ChatRecordLast : Serializable {

    @PrimaryKey(autoGenerate = true)
    var id: Int = 0
    @ColumnInfo(name = "f_id")
    var fId: Int = 0
    @ColumnInfo(name = "name")
    var name: String? = null
    @ColumnInfo(name = "body")
    var body: String? = null
    @ColumnInfo(name = "time")
    var time: Long = 0
    @ColumnInfo(name = "type")
    var type: Int = 0

    companion object {
        private const val serialVersionUID = 42L
    }
}
